petitcomputerfandomcom-20200214-history
SimpleC Interpreter
I got bored one day and decided to make a simple interpreter of a language called SimpleC. It is HEAVILY influenced by C++, so if you know the language, this shouldn't be hard at all to learn. This interpreter includes: Max of 999 lines Up to 250+ strings and 250+ variables Input/output IF...THEN...ELSE like statement (WHEN...DO...ELSE) Math Basic/essential commands Basic graphics Objects (sprites) Instructions Enter a line, and press A. Move the dot you see to the next line you want to edit and press A again. To run, instead of selecting a line with the dot, press B. To save your program, press X. To load a program, press Y. List of commands and their syntax listed below. Changelog Version 1.2 *Added ability to have up to 999 lines, 250+ strings, 250+ variables, saving and loading programs, ELSE command, fixed glitches with the WHEN command, finished development. Version 1.1 *Renamed to SimpleC, major changes to syntax of almost every command, GOTO, added object support. Version 1.0 *Basic essential commands, edit mode, run mode Download Command List Download the .rtf file containing a tutorial of the entire language at http://www.2shared.com/document/6WhyCHsw/SimpleC_Manual.html Notes This program's development is finished. If you have anything else you'd like me to add, tell me and I'll consider it. Feel free to post your programs in the comments section! I'd love to see what you guys are making! Example Programs Here's a few sample programs I made to help you guys out. Hello world: OUT<"Hello, world!" SLP[BUT16] STOP Demonstrating input/output: START: OUT<"Hello!\n" OUT<"How are you? (GOOD/BAD)\n" IN> STRA SETV STRG=GOOD SETV STRB=BAD WHEN STRA=G DO{ OUT<"Awesome!" GOTO END ELSE{ WHEN STRA=B DO{ OUT<"Awww. Hope you feel better." GOTO END } }} OUT<"Oops! I don't know what " OUT Demonstrating graphics: OUT<"Here's a circle!" DRAW.CRCL127;95,20 67 SLP[BUT16] Allows you to move an object around the screen: OBJCT.SET1,0;0,0 SETV VAR1=1 LOOP: WHEN BUT[]=1 DO{ MATH Y=Y-1 } WHEN BUT[]=2 DO{ MATH Y=Y+1 } WHEN BUT[]=4 DO{ MATH X=X-1 } WHEN BUT[]=8 DO{ MATH X=X+1 } OBJCT.MOV1,X;Y WHEN BUT[]=16 DO{ STOP ELSE{ GOTO LOOP }} This demonstrates the speed of the language: VCLR SETV VAR1=1 LOOP: MATH L=L+1 OUT These are source code examples. Here's some slightly different but scannable programs! Credits IAmAPerson620 - Everything License The Free-Use License Copyright © 2013 Persson Creations In downloading this program, permission is given to ANY and ALL users to use and edit this software. However, this software may NOT be redistributed to ANYONE without permission from IAmAPersson, even if unedited. If this is ignored, the redistributed program will be reported and deleted ASAP. This software comes AS IS. It comes with NO warranty whatsoever. If the program does not work as expected, the user MAY report the problem to IAmAPersson, but NO certainty is given that it will be fixed. IAmAPersson is NOT responsible for ANY damages, including but not limited to the user's device and/or the software due to misuse. The software name "SimpleC Interpreter" belongs completely to IAmAPersson, and may NOT be used as a name for ANY other program. If this software is redistributed rightly according to the regulations of this license, the redistributor is REQUIRED to include this license with his/her copy of "SimpleC Interpreter," along with a link to the original program. The user is also required to give a disclaimer, stating that he/she is NOT the original creator of the software, and give credit appropriately. By downloading "SimpleC Interpreter," any and all users agree to follow ALL points stated in this license, and to use this program rightly in all ways, shapes, AND forms. Where You Can Find Me I can be found on the NintendoLife Petit Computer Forums . If you have a question about programming and you with for an answer not-on-forum, use my Message Wall! I am also on the Special Chat a lot! I do not give out my email, so do not even ask. 3DS Friend Code: 2148-9259-0831 Category:Programs Category:Applications Category:Interpreter Category:Tools